import React from 'react';

export type Style = React.CSSProperties;

//组件类型
export interface Icomp {
    style: Style;
    title?: string;
    type: number;
    value: string;
    link?: string;
    key?: string;
    fun?: () => object;
}
export interface Info {
    index: number;
    left: number;
    top: number;
}

//画布类型
export interface Iview {
    title: string;
    style: Style;
    comps: Array<Icomp> 
}

//初始化页面
export type EditView = {
    view: Iview;
}

//新增组件
export type Addcomp = (_cmp: Icomp) =>  void
export type ClaerView = () =>  void
export type MoveView = (info: Info) =>  void
export type EditViewAction = {
    addcopm: Addcomp;
    claearView: ClaerView;
    moveView: MoveView
}

export interface IEditStore extends EditView, EditViewAction {}